import request from '@/utils/http'

export function addRole (payload) {
  return request({
    url: 'role/insert',
    method: 'post',
    data: payload
  })
}

export function updateRole (_id, payload) {
  return request({
    url: 'role/update',
    method: 'put',
    data: payload
  })
}

export function getRole (payload) {
  return request({
    url: 'role/findByN',
    method: 'get',
    params: payload
  })
}

export function deleteRole (_id, payload) {
  return request({
    url: 'role/delete',
    method: 'delete',
    data: payload
  })
}

export function findAllRole () {
  return request({
    url: 'role/findAll',
    method: 'get'
  })
}

export function getOneUser (_id) {
  return request({
    url: 'getOneUser/' + _id,
    method: 'get'
  })
}
